home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_053
/
compiler
/
searchkw.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
2KB
|
54 lines
#include <stdio.h>
#include "c.h"
#include "expr.h"
#include "gen.h"
#include "cglbdec.h"
/*
* 68000 C compiler
*
* Copyright 1984, 1985, 1986 Matthew Brandt.
* all commercial rights reserved.
*
* This compiler is intended as an instructive tool for personal use. Any
* use for profit without the written consent of the author is prohibited.
*
* This compiler may be distributed freely for non-commercial use as long
* as this notice stays intact. Please forward any enhancements or questions
* to:
*
* Matthew Brandt
* Box 920337
* Norcross, Ga 30092
*/
struct kwblk {
char *word;
enum e_sym stype;
} keywords[] = {
{"int", kw_int}, {"char", kw_char}, {"long", kw_long},
{"float", kw_float}, {"double", kw_double}, {"return", kw_return},
{"struct", kw_struct}, {"union", kw_union}, {"typedef", kw_typedef},
{"enum", kw_enum}, {"static", kw_static}, {"auto", kw_auto},
{"sizeof", kw_sizeof}, {"do", kw_do}, {"if", kw_if},
{"else", kw_else}, {"for", kw_for},{"switch", kw_switch},
{"while", kw_while},{"short", kw_short}, {"extern", kw_extern},
{"case", kw_case}, {"goto", kw_goto}, {"default", kw_default},
{"register", kw_register}, {"unsigned", kw_unsigned},
{"break", kw_break}, {"continue", kw_continue}, {"void", kw_void},
{0, 0} };
enum e_sym searchkw()
{
struct kwblk *kwbp;
kwbp = keywords;
while(kwbp->word != 0) {
if(strcmp(lastid,kwbp->word) == 0)
return (lastst = kwbp->stype);
else
++kwbp;
}
return (lastst);
}